<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/jsplib/pubhead.jsp"%>
<%@ page import="net.comm.common.ValueMaping" %>
<%@ taglib uri="/WEB-INF/myTaglib.tld" prefix="tag"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>首席客服</title>
	<link href="${cpath}/css/youlin.css" rel="stylesheet" type="text/css" media="all" />
	<script src="${cpath}/js/SpryTabbedPanels.js" type="text/javascript"></script>
	<link href="${cpath}/css/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
	<link  href="${cpath}/css/pop.css" rel="stylesheet" type="text/css">
	<SCRIPT src="${cpath}/js/global.js" type=text/javascript></SCRIPT>

</head>

<% 
	String tabindex = (String)request.getAttribute("tabindex");
	if(tabindex == null) tabindex = "0";
%>

<body>
<!--外套 start -->
<div class="wrap">
  <!--页首 start -->
	<%@ include file="/menu.jsp"%>
  <!--页首 end -->  
  
  <!--导航面包屑 start -->
  <div class="breadCrumb">
  <div class="breadCrumbNav">当前位置：<a href="${cpath}/users.do?action=main">我的主页</a> >> <a > 首席客服</a></div>
	<%@ include file="/navf.jsp"%>
 </div> 
  <!--导航面包屑 end -->
  
  <!--主体 start -->
 <div class="body">
   <div class="leftBox"> 
       
     <div class="leftBox-5">  
	   <div class="leftBox-5-left">   
			<a href="${cpath}/users_home/userID_${userform.userID}.html"><img class="user_icon_1" src="${cpath}/${myfn:getUserPic(userform.userID)}"  width="75" height="75"  title="${myfn:getUserNick(userform.userID)}"/></a>		 
			<p>首席客服：<b><A href="${cpath}/users_home/userID_${userform.userID}.html" >${userform.name}</A></b></p>
			<p>&nbsp;&nbsp;&nbsp;&nbsp;客服ID：${userform.userID}</p>
			<p>&nbsp;</p>
			<c:if test="${userform.userID == userID }">	
			<p><a href="${cpath}/notadv.do?action=addPage&ntype=1&nsort=4" class="lineColor1">发布公告</a>&nbsp;&nbsp;<a href="${cpath}/notadv.do?action=addPage&ntype=6&nsort=4" class="lineColor1">发布常见问题</a></p>
			</c:if>

	   </div>
	   <!--
	   <div class="leftBox-5-right">
		 <p><b>有事您说话，马上办理！</b></p>
		 <p><a href="javascript:doLiuyan();"><img src="${cpath}/images/icon_18.gif" width="215" height="50" /></a></p>
	   </div>-->
  </div>
     
<!-- 选项卡 开始-->
<div id="TabbedPanels1" class="TabbedPanels">
  <ul class="TabbedPanelsTabGroup">
    <li class="TabbedPanelsTab" id = "tab0" tabindex="0">常见问题</li>
    <li class="TabbedPanelsTab" id = "tab1" tabindex="1">投诉</li>
    <li class="TabbedPanelsTab" id = "tab2" tabindex="2">建议</li>
  </ul>
  <div class="TabbedPanelsContentGroup">
    <!-- 常见问题开始-->
    <div class="TabbedPanelsContent">
     <div class="faq">
	
        <ul class="noticeList" style="width:560px;">
		<c:forEach var="notadv" items="${notadvlist}" varStatus="status">
		<c:if test="${notadv.ntype == '6'}">
        <li><span class="s1"><a href="${cpath}/notadv.do?action=detail&qrySeqID=${notadv.seqID}">${notadv.title}</a></span> </li>
		</c:if>
		</c:forEach>            
        </ul>	  

     </div>  
	 <!--
 	<form class="notice_from" action="${cpath}/notadv.do?action=add" name="wentiForm" id="wentiForm" method="post" enctype="multipart/form-data">
        <p class="notice_from_top" style=" padding-left:0; padding-top:30px;" id="natitle">我要提问</p>
        <p><textarea class="input" name="content" cols="" rows="" style="width:100%;"></textarea></p>     
		<p><a href="javascript:notAdd('wentiForm');"><img src="${cpath}/images/icon_30.gif" width="82" height="23" /></a></p>
		<input type="hidden" name='userID'	value='${userID}'/>
		<input type="hidden" name='seqID'	value=''/>
		<input type="hidden" name='ntype'	value='6'/>
		<input type="hidden" name='nsort'	value='4'/>
		<input type="hidden" name='nsortID' value=''/>
		<input type="hidden" name='title'	value='${username}的问题'/>
	</form>-->	
    </div>
    <!-- 常见问题 结束-->
    
    <!-- 投诉 开始-->
    <div class="TabbedPanelsContent">
     <div class="faq">
	 <c:forEach var="tousu" items="${tousulist}" varStatus="status">
 	  <c:if test="${tousu.follID == 0}">
      <div class="faq-top">
          <span>${tousu.title}</span>
          <span class="s2">
		  <c:if test="${userform.userID == userID}">		  
		  <a href="javascript:doreply('tousuForm','${tousu.seqID}','${tousu.title}','${tousu.ntype}', '${tousu.nsort}',  '${tousu.nsortID}')">回复(${tousu.replycnt})</a>	 
		  </c:if>
		 
		  </span>
     </div>
	 </c:if>
      <div class="faq-reply">
        <p>
           <span class="s1"><A title="${myfn:getUserNick(tousu.userID)}" href="${cpath}/users_home/userID_${tousu.userID}.html" target="_blank"><img src="${cpath}/${myfn:getUserPic(tousu.userID)}" width="22" height="23" align="middle" /></A></span>        
           <span class="s2">${myfn:getUserNick(tousu.userID)}</span>        
           <span>${myfn:formatMDHM(tousu.mtime)}</span>
       </p>
        <p class="p2">${tousu.content}</p> 
         <c:if test="${userform.userID == userID}">
        <p class="p3" align="right"> <a href="${cpath}/shenqing.do?action=delete&SeqID=${tousu.seqID}&tabindex=1">删除</a></p>    
      	</c:if>
      </div>        
	 </c:forEach>		
	  
     </div>   
	<form class="notice_from" action="${cpath}/notadv.do?action=add" name="tousuForm" id="tousuForm" method="post" enctype="multipart/form-data">
	<c:if test="${userform.userID == userID}">
        <p class="notice_from_top" style=" padding-left:0; padding-top:30px;" id="natitle">回复</p>
        </c:if>
        <c:if test="${userform.userID != userID}">
        <p class="notice_from_top" style=" padding-left:0; padding-top:30px;" id="natitle">我要投诉</p>
        </c:if>
        <p><textarea class="input" name="content" cols="" rows="" style="width:100%;"></textarea></p>     
		<p><a href="javascript:notAdd('tousuForm');"><img src="${cpath}/images/icon_30.gif" width="82" height="23" /></a></p>
		<input type="hidden" name='userID'	value='${userID}'/>
		<input type="hidden" name='seqID'	value=''/>
		<input type="hidden" name='ntype'	value='3'/>
		<input type="hidden" name='nsort'	value='4'/>
		<input type="hidden" name='nsortID' value=''/>
		<input type="hidden" name='title'	value='${username}的投诉'/>
	</form>	
	</div>
    <!-- 投诉 结束-->
    
    <!-- 建议 开始-->
    <div class="TabbedPanelsContent">
     <div class="faq">
	 <c:forEach var="jianyi" items="${jianyilist}" varStatus="status">
 	  <c:if test="${jianyi.follID == 0}">
      <div class="faq-top">
          <span>${jianyi.title}</span>
          <span class="s2">
		  
		  </span>
     </div>
	 </c:if>
      <div class="faq-reply">
        <p>
           <span class="s1"><A title="${myfn:getUserNick(jianyi.userID)}" href="${cpath}/users_home/userID_${jianyi.userID}.html" target="_blank"><img src="${cpath}/${myfn:getUserPic(jianyi.userID)}" width="22" height="23" align="middle" /></A></span>
           <span class="s2">${myfn:getUserNick(jianyi.userID)}</span>        
           <span>${myfn:formatMDHM(jianyi.mtime)}</span>
       </p>
        <p>${jianyi.content}</p>
        <c:if test="${userform.userID == userID}">
		     <p class="p3" align="right"> <a href="${cpath}/shenqing.do?action=delete&SeqID=${jianyi.seqID}&tabindex=2">删除</a></p>     
		  </c:if>
      </div>   
	 </c:forEach>	  
     </div>  	
	<form class="notice_from" action="${cpath}/notadv.do?action=add" name="jianyiForm" id="jianyiForm" method="post" enctype="multipart/form-data">
	   <c:if test="${userform.userID == userID}">
        <p class="notice_from_top" style=" padding-left:0; padding-top:30px;" id="natitle">回复</p>
        </c:if>
        <c:if test="${userform.userID != userID}">
        <p class="notice_from_top" style=" padding-left:0; padding-top:30px;" id="natitle">我的建议</p>
        </c:if>
        <p><textarea class="input" name="content" cols="" rows="" style="width:100%;"></textarea></p>     
		<p><a href="javascript:notAdd('jianyiForm');"><img src="${cpath}/images/icon_30.gif" width="82" height="23" /></a></p>
		<input type="hidden" name='userID'	value='${userID}'/>
		<input type="hidden" name='seqID'	value=''/>
		<input type="hidden" name='ntype'	value='4'/>
		<input type="hidden" name='nsort'	value='4'/>
		<input type="hidden" name='nsortID' value=''/>
		<input type="hidden" name='title'	value='${username}的建议'/>
	</form>	
	</div>
    <!-- 建议 结束-->
  </div>
</div>

<!-- 选项卡 结束-->   
   </div> 
    <SCRIPT> 
　　        window.open ('shequ/shensu.jsp') 
　　</SCRIPT> 
    
	<SCRIPT>
	/**
     * 
     */
	function doLiuyan()
	{
		var userID = "${userID}";
		if(userID == '' ){
			alert('请登录网站');
			window.location.href ="${cpath}/index.jsp";
			return false;
		}
		openNewDiv('email');
	}
	/**
     * 
     */
	function doreply(obj, id,tit,ntyp, nsor, nsorID)
	{
		var form = document.getElementById(obj);

		form.title.value = tit + "的回复";
		form.seqID.value = id;
		form.ntype.value = ntyp;
		form.nsort.value = nsor;
		form.nsortID.value = nsorID;
		form.content.focus();
	}
	
	/**
     * 
     */
	function notAdd(obj)
	{
		var userID = "${userID}";
		if(userID == '' ){
			alert('请登录网站');
			window.location.href ="${cpath}/index.jsp";
			return false;
		}
		var form = document.getElementById(obj);

		var content = form.content;
		var title = form.title;

		if(!confirm('确认提交' + title.value + "?" )){
			return false;
		}

		if(content.value == null||content.value.replace(/(^\s*)|(\s*$)/g,"").length < 1)
  		{
			alert('内容不能为空');
			content.select();
			return ;
		}
		if(content.value.replace(/(^\s*)|(\s*$)/g,"").length > 2000)
  		{
			alert('内容长度不能大于2000');
			content.select();
			return ;
		}

		form.submit();
	}
	</script>

  <div class="rightBox">
    <div class="rightBox-2">
      <h3><span>网站公告</span><a class="more2" href="${cpath}/notadv.do?action=list&qryNtype=1&qryNsort=4">+ 更多</a></h3>
      <div class="rightBox-2-content">
          <ul class="noticeList">
			<c:forEach var="notadv" items="${notadvlist}" varStatus="status"  end="5">
			<c:if test="${notadv.ntype == '1'}">
           <li><span class="s1"><a href="${cpath}/notadv.do?action=detail&qrySeqID=${notadv.seqID}">${notadv.title}</a></span> <span class="s2">${myfn:formatYYYYMMDD(notadv.mtime,'/')}</span></li>
			</c:if>
			</c:forEach>            
          </ul>
          <div class="clearFloat"></div>
      </div>
     </div>
     
	<div class="rightBox-2">
      <h3><span>机构申请认证</span></h3>
      <div class="rightBox-2-content">     
 		<form action="${cpath}/shenqing.do?action=add" name="shenqingForm" method="post" enctype="multipart/form-data" class="frmApply">
              <p><label>机构类型：</label>
                <tag:ARRAY  id="jgType" name="jgType" options="<%=ValueMaping.JIGOU_TYPE%>" value='' onchange="javascript:chgname(this.value);"/>
              </p>
              <p><label>机构名称：</label>
                  <input type="text" name='jgName' value='' />
              </p>
              <p><label>服务社区：</label>
				<tag:CNPCA name="work_location" id="work_location" pid="0" cid="0" value='1962'   onchange="getAjaxdata('cnpid',this.value)" onkeydown="catch_keydown(this);"  css='w70'/>
				<span id=cnpid style="display:inline">
				<tag:CNPCA name="work_sublocation" pid="1962" cid="0" value='1987'  onchange="getAjaxdata('cncid',this.value)" onkeydown="catch_keydown(this);"  css='w70'/>
				</span><br>
				<label>&nbsp;</label>
				&nbsp;<span id=cncid style="display:inline">
				<tag:CNPCA name="work_area" id="work_area" cid="1987"  value=''  onkeydown="catch_keydown(this);" onchange="getVillageSelect('villagediv',this.value)"  css='w70'/>
				</span><br>
				<label>&nbsp;</label>
				&nbsp;<span id=villagediv style="display:inline">
				<tag:VILLAGE name="villageID" work_area="" value=''   onkeydown="catch_keydown(this);"/>
				</span>小区

              </p>
              <p><label>服务内容：</label>
                  <textarea name="content" rows="4" cols="26" ></textarea>
              </p>
              <p><label>负&nbsp;&nbsp;责&nbsp;&nbsp;人：</label>
                 ${myfn:getUserNick(userID)}
              </p>
              <p><label>联系方式：</label>
                 <input type="text" name='tel' value='' class="w70" />
              </p>
              <p><label>资&nbsp;&nbsp;料&nbsp;&nbsp;一：</label>
                  <input type="file" name='filepath1' value='' class="s150" onchange="check_loadfile(this);" />
              </p>
            <p><label>资&nbsp;&nbsp;料&nbsp;&nbsp;二：</label>
                <input type="file" name='filepath2' value='' class="s150" onchange="check_loadfile(this);" />
            </p>
            <p align="center"><a href="javascript:doShenqing();"><img src="${cpath}/images/icon_30.gif" width="82" height="23" /></a></p>
			<input type="hidden" name='userID'	value='${userID}'/>
			<INPUT id=max_file_size type=hidden value=3096152 name=MAX_FILE_SIZE>
			<IMG id=oFileChecker style="WIDTH: 0px; HEIGHT: 0px" onload=check_photo_size()>
         
            </form> 
      </div>
     </div>
  </div>
    
    <div class="clearFloat"></div>
 </div> 
 <!--主体 end -->
 
 <!--页脚 start -->
	<%@ include file="/foot.jsp"%>
 <!--页脚 end --> 
 </div>
 <!--外套 end -->
		<!-- 转发 弹出层 -->
		<DIV class=dragdiv id=email style="DISPLAY:none ">
		<DIV class="otherdiv filterbox">
		<B class=g1></B><B class=g2></B><B class=g3></B><B class=g4></B>
		<DIV class="content filterbox"></DIV>
		<B class=g4></B><B class=g3></B><B class=g2></B><B class=g1></B></DIV>
		<DIV class=otherdivin>
		<H2><SPAN><A title=关闭 style="CURSOR: pointer" onclick="closeMask('email')"><IMG src="${cpath}/icon/icon02.gif"></A></SPAN>发送留言： </H2>
 		<form action="${cpath}/notadv.do?action=add" name="liuyanForm"  method="post" >
			<DL  id="emaildl">
			<DD><EM>标  题：</EM><SPAN><input type='text' name='title' value='${username}的留言' class="long"/></SPAN></DD>
			<DD><textarea name="content" rows="10" cols="50" ></textarea>
			</DD>
			<DD><EM><INPUT type=button class='shortBtn' name=send value="确  定" onclick="addliuyan();">&nbsp;&nbsp;
			<INPUT type=button class='shortBtn'  name=cancel value="取  消" onclick="closeMask('email');"></EM>
			</DD>
			</DL>
			<!--隐藏域-->
			<input type="hidden" name='userID'	value='${userID}'/>
			<input type="hidden" name='nsort'	value='5'/>
			<input type="hidden" name='nsortID' value='${userID}'/>
			<input type="hidden" name='ntype'	value='5'/>
		</form>  
		</DIV></DIV><!-- 弹出层结束 -->
	<script type="text/javascript">
	<!--
	var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
	//-->
	</script>
</body>
</html>
<script type="text/javascript">
		//弹出提示层
		function openNewDiv(_id) 
		{
				var m = "mask";
				if(document.getElementById(m)) document.body.removeChild(document.getElementById(m));
				var newMask = document.createElement("div");
				newMask.id = m;
				newMask.style.position = "absolute";
				newMask.style.zIndex = "1";
				_scrollWidth = Math.max(document.body.scrollWidth,document.documentElement.scrollWidth);
				_scrollHeight = Math.max(document.body.scrollHeight,document.documentElement.scrollHeight);
				newMask.style.width = _scrollWidth + "px";
				newMask.style.height = _scrollHeight + "px";
				newMask.style.top = "0px";
				newMask.style.left = "0px";
				newMask.style.background = "#33393C";
				newMask.style.filter = "alpha(opacity=40)";
				newMask.style.opacity = "0.30";
				document.body.appendChild(newMask);
				showDiv = document.getElementById(_id);
				showDiv.style.display = "block";
				showDiv.style.position = "absolute";
				showDiv.style.zIndex = "9999";
				showDivWidth = 488;
				showDivHeight = 314;
				showDiv.style.top = (document.documentElement.scrollTop + document.documentElement.clientHeight/2 - showDivHeight/2) + "px";
				showDiv.style.left = (document.documentElement.scrollLeft + document.documentElement.clientWidth/2 -  showDivWidth/2) + "px";
		}
		function closeMask(_id)
		{
				var m = "mask";
				if(document.getElementById(m)) document.body.removeChild(document.getElementById(m));
				showDiv = document.getElementById(_id);
				showDiv.style.display = "none";
		}

    /**
     * 检查项目资料维护
     */
	function chgname(thisval)
	{
		var form = document.shenqingForm;
		var jgName = form['jgName'];

		if(thisval == "1"){
			
			jgName.value = "业委会";
		}else if(thisval == "2"){

			jgName.value = "物业处";
		}
	}
	
   /**
     * 检查项目资料维护
     */
	function addliuyan()
	{
		var form = document.liuyanForm;

		var action = form['action'];
		var ntype = form['ntype'];
		if(ntype.value == "")
  		{
			alert('类型不能为空');
			ntype.select();
			return ;
		}

		var title = form['title'];
		if(title.value == null||title.value.replace(/(^\s*)|(\s*$)/g,"").length < 1)
  		{
			alert('标题不能为空');
			title.select();
			return ;
		}
		var nsort = form['nsort'];
		if(nsort.value == "")
  		{
			alert('板块不能为空');
			nsort.select();
			return ;
		}
		var content = form['content'];

		if(content.value.replace(/(^\s*)|(\s*$)/g,"").length < 1)
		{
			alert('内容不能为空');
			return ;
		}

		if(content.value.length > 2000)
		{
			alert('内容长度不能大于2000');
			return ;
		}

		form.submit();
	}

	/**
     * 检查项目资料维护
     */
	function doShenqing()
	{

		var userID = "${userID}";

		if(userID == '' ){
			alert('提交机构申请认证，需要登录网站');
			window.location.href ="${cpath}/index.jsp";
			return false;
		}
		
		var form = document.shenqingForm;

		var jgType = form['jgType'];
		if(jgType.value == "")
  		{
			alert('机构类型不能为空');
			jgType.select();
			return ;
		}

		var jgName = form['jgName'];
		if(jgName.value == null||jgName.value.replace(/(^\s*)|(\s*$)/g,"").length < 1)
  		{
			alert('机构名称不能为空');
			jgName.select();
			return ;
		}

		var villageID = form['villageID'];
		if(villageID.value == "")
  		{
			alert('服务社区不能为空');
			villageID.select();
			return ;
		}

		var content = form['content'];
		if(content.value.replace(/(^\s*)|(\s*$)/g,"").length > 3000)
  		{
			alert('内容长度不能大于2000');
			content.select();
			return ;
		}

		var userID = form['userID'];
		if(userID.value == null||userID.value.replace(/(^\s*)|(\s*$)/g,"").length < 1)
  		{
			alert('负责人ID不能为空');
			userID.select();
			return ;
		}
		var tel = form['tel'];
		if(tel.value == null||tel.value.replace(/(^\s*)|(\s*$)/g,"").length < 1)
  		{
			alert('联系方式不能为空');
			tel.select();
			return ;
		}
		var filepath1 = form['filepath1'];
        if(filepath1.value != "" && !check_loadfile(filepath1))
        {
			return false;
        }		

		var filepath2 = form['filepath2'];
        if(filepath2.value != "" && !check_loadfile(filepath2))
        {
			return false;
        }

		form.submit();
	}
	function check_photo_size()
	{
		img_temp = my_getbyid('oFileChecker');
		var limit = parseInt(my_getbyid('max_file_size').value);
		if (img_temp.fileSize > limit) {
			alert("照片文件过大，请选择2M以下的文件上传");
			return false;
		}
	}
	function check_loadfile(filePicker)
	{
		var patn = /.jpg$|.jpeg$|.gif$/i;  
		if(patn.test(filePicker.value)) {
			img_temp = my_getbyid('oFileChecker');
			img_temp.src = filePicker.value;
		} else {

			var patn2 = /.doc$|.xls$|.ppt$|.rar$|.txt$/i;  
			if(!patn2.test(filePicker.value)) {			
				alert('您选择的不是合法的文件,支持文件格式：.jpg/.jpeg/.gif/.doc/.xls/.ppt/.rar/.txt，请重新选择');
				filePicker.value='';
				return false;
			}
		}
		return true;
	}

	function my_getbyid(id)
	{

		 itm = null;
		 if (document.getElementById)
		 {
				itm = document.getElementById(id);
		 }
		 else if (document.all)
		 {
				itm = document.all[id];
		 }
		 else if (document.layers)
		 {
				itm = document.layers[id];
		 }
		 
		 return itm;
	}
	function getVillageSelect(div,id)
	{

		if(id == 0 || id == ""){
			alert("请选择所在区县");
			return;
		}

		var xmlHttp;
		start = true;
		try
		{    // Firefox, Opera 8.0+, Safari    
			xmlHttp=new XMLHttpRequest();
		}
		catch (e)
		{    // Internet Explorer    
			try
			{
				xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch (e)
			{
				try
				{
					xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch (e)
				{
					alert("Your browser does not support AJAX!");
					return false;
				}
			}
		}
		var url;
		
		url = "${cpath}/shequ/getVillageSelect.jsp?work_area=" + id ;
		my_getbyid(div).innerHTML="<select name='villageID' onkeydown='catch_keydown(this);'></select>";
		if (start)
		{
			my_getbyid(div).innerHTML='后台取数据……';
			xmlHttp.onreadystatechange=function()
			{
				if(xmlHttp.readyState==4 && xmlHttp.status==200)
				{
					var ret_str = xmlHttp.responseText;

					var secsort = "<select name='villageID' onkeydown='catch_keydown(this);'>" +
							ret_str.replace(/(^\s*)|(\s*$)/g,"") + "</select>";
					my_getbyid(div).innerHTML = secsort;
				}
			}
			xmlHttp.open("GET",url,true);
			xmlHttp.send(null);
		}
	}
	function getAjaxdata(div,id)
	{

		var xmlHttp;
		start = true;
		try
		{    // Firefox, Opera 8.0+, Safari    
			xmlHttp=new XMLHttpRequest();
		}
		catch (e)
		{    // Internet Explorer    
			try
			{
				xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch (e)
			{
				try
				{
					xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch (e)
				{
					alert("Your browser does not support AJAX!");
					return false;
				}
			}
		}
		var url;
		if(div =="divsecsort"){

			url = "${cpath}/param/getproperty.jsp?assortID=2&parentID=" + id ;

		}else if(div =="cnpid" ){
		
			url = "${cpath}/param/getCnpid.jsp?pid=" + id ;
			my_getbyid("cncid").innerHTML="<select name='work_Area' onkeydown='catch_keydown(this);'></select>";
		}else if(div =="homepid" ){
		
			url = "${cpath}/param/getCnpid.jsp?pid=" + id ;
//			my_getbyid("homecid").innerHTML="<select name='work_Area' onkeydown='catch_keydown(this);'></select>";
		}else {

			url = "${cpath}/param/getCncid.jsp?cid=" + id;
		}
		if (start)
		{
			my_getbyid(div).innerHTML='后台取数据……';
			xmlHttp.onreadystatechange=function()
			{
				if(xmlHttp.readyState==4 && xmlHttp.status==200)
				{
					var ret_str = xmlHttp.responseText;
					if(div =="divsecsort"){
						var secsort = "<select name='secsort' onkeydown='catch_keydown(this);'>" +
							ret_str.replace(/(^\s*)|(\s*$)/g,"") + "</select>"
						my_getbyid(div).innerHTML = secsort;

					}else if(div =="cnpid"){

						var secsort = "<select name='work_sublocation' onkeydown='catch_keydown(this);' css='w70'" +
							" onChange=\"getAjaxdata('cncid',this.value)\">" + 
							ret_str.replace(/(^\s*)|(\s*$)/g,"") + "</select>"
						my_getbyid(div).innerHTML = secsort;

					}else if(div =="homepid"){

						var secsort = "<select name='home_sublocation' onkeydown='catch_keydown(this);' css='w70'" +
							" >" + 
							ret_str.replace(/(^\s*)|(\s*$)/g,"") + "</select>"
						my_getbyid(div).innerHTML = secsort;

					}else if(div =="homecid"){

						var secsort = "<select name='home_area' id='home_area' onkeydown='catch_keydown(this);'  css='w70'>" +
							ret_str.replace(/(^\s*)|(\s*$)/g,"") + "</select>"
						my_getbyid(div).innerHTML = secsort;

					}else{
						var secsort = "<select name='work_area' id='work_area' onkeydown='catch_keydown(this);'  onChange=\"getVillageSelect('villagediv',this.value)\" css='w70'>" +
							ret_str.replace(/(^\s*)|(\s*$)/g,"") + "</select>"
						my_getbyid(div).innerHTML = secsort;
					}
				}
			}
			xmlHttp.open("GET",url,true);
			xmlHttp.send(null);
		}
	}

	window.onload = function() {
		document.getElementById("tab<%=tabindex%>").click();
	}
</script>
